<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>记事本</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
  </head>
  <body>
    <div id="app">
      <input type="text" v-model="msg" @keyup.enter="submit" />
      <h1>未完成事件</h1>
      <div v-for="(todo,index) in todoList">
        <input
          type="checkbox"
          :key="todo.key"
          @change="doneList.push(todoList.splice(index,1)[0])"
        />
        {{todo.value}}
        <button @click="todoList.splice(index,1)">删除</button>
      </div>
      <h1>已经完成事件</h1>
      <div v-for="(done,index) in doneList">
        <input
          type="checkbox"
          checked="true"
          :key="done.key"
          @change="todoList.push(doneList.splice(index,1)[0])"
        />
        {{done.value}}
        <button @click="doneList.splice(index,1)">删除</button>
      </div>
    </div>
  </body>
</html>
